package cn.hznc.controller.service.toollife.logic;

import cn.hznc.domain.entity.ProcessBomEntity;
import cn.hznc.domain.entity.ProcessCraftEntity;
import cn.hznc.domain.entity.ToolLifeEntity;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author：Administrator
 * @Date：2023/6/3 14:52
 */
@Getter
@Setter
public class ToolLifeDo{

    private List<ToolLifeEntity> createElement= new ArrayList<>();

    private List<ToolLifeEntity> deleteElement= new ArrayList<>();

    private List<ToolLifeEntity> updateElement= new ArrayList<>();

    /**
     * 添加新增的原素
     *
     * @param element element
     * @return boolean
     */
    public boolean addCreateElement(ToolLifeEntity element){
        return createElement.add(element);
    }

    /**
     * 添加新增的原素
     *
     * @param element element
     * @return boolean
     */
    public boolean addCreateElement(List<ToolLifeEntity> element){
        return createElement.addAll(element);
    }

    /**
     * 添加删除的元素
     *
     * @param element element
     * @return boolean
     */
    public boolean addDeleteElement(ToolLifeEntity element){
        return deleteElement.add(element);
    }

    /**
     * 添加删除的元素
     *
     * @param element element
     * @return boolean
     */
    public boolean addDeleteElement(List<ToolLifeEntity> element){
        return deleteElement.addAll(element);
    }

    /**
     * 添加新增的原素
     *
     * @param element element
     * @return boolean
     */
    public boolean addUpdateElement(ToolLifeEntity element){
        return updateElement.add(element);
    }
}
